import operation.Typeoperation;
import user.Administrator;
import user.Normal;
import user.User;

import java.util.Scanner;

public class Main {
    public static User login(){
        Scanner sc = new Scanner(System.in);
        System.out.println("欢迎来到图书管理系统，请输入您的姓名");
        String name = sc.nextLine();
        System.out.println("您好，" + name + "请选择您的身份：0_管理员 1_普通用户");
        if(sc.nextInt() == 0){
            return new Administrator(name);
        }else{
            return new Normal(name);
        }

    }
    public static void main(String[] args) {
        User user = login();
        while(true) {
            int choice = user.menu();
            user.work(choice);
        }
    }
}
